#include <iostream>
using namespace std;
int n,m;
int s[81];
int a[50000][100];
int shuzhugeshu=0;
int num=0;
int main()
{
	while(cin>>n){
		for(int i=0;i<n;i++){
			cin>>m;
			for(int j=0;j<m;j++) cin>>s[j];
			
			for(int k=0;k<m;k++){
				
				if(k==0){
					if(s[k]!=s[k+1]){
						a[shuzhugeshu][num]=k;
						num++;
						continue;
					}
				}
				if(s[k]>s[k-1]&&s[k]>s[k+1]){
					a[shuzhugeshu][num]=k;
					num++;
					continue;
				}
				if(s[k]<s[k-1]&&s[k]<s[k+1]){
					a[shuzhugeshu][num]=k;
					num++;
					continue;
				}
				if(k==m-1){
					if(s[k]!=s[k-1]){
						a[shuzhugeshu][num]=k;
						num++;
						continue;
					}
				}
				
			}
			
			a[shuzhugeshu][num]=-1;
			num=0;
			shuzhugeshu++;
		}
		
		for(int h=0;h<n;h++){
			int q=0;
			if(a[h][0]==-1) continue;
			while(a[h][q+1]!=-1){
				cout<<a[h][q]<<" ";
				q++;
			}
			cout<<a[h][q]<<endl;
		}
		shuzhugeshu=0;
		num=0;
	}
}
